<template>
    <div class="order">
        <Tit :tit="tit"></Tit>
        <div class="top">
            <div>收货人：钱先生 <span>12345678912</span></div>
            <div class="second">收货地址：北京市海定区西三旗 <span> > </span></div>
        </div>

        <div class="card">
                <van-row>
                    <van-col span="2" class="checkbox">
                        <!-- <input type="checkbox" name="" class="checkbox" /> -->
                    </van-col>
                    <van-col span="18" class="main">
                        <div class="pic">
                            <img
                                src="../../assets/shopcartimg/sf1.png"
                                alt=""
                            />
                        </div>
                        <div class="dis">
                            <div >  {{list.name}} </div>
                            <div class="red"> {{list.price}} </div>
                        </div>
                    </van-col>
                    <van-col span="4" v-model="value">
            
                    </van-col>
                </van-row>
            </div>


        <div class="line">店铺优惠 <span>满100包邮</span></div>
        <div class="line">配送方式 <span>快递免邮</span></div>
        <van-submit-bar :price="price" button-text="提交订单" @submit="onSubmit" />
    </div>
</template>

<script>
import Tit from "../../components/tit.vue";
import {
    getAddUserlist
} from '../../api/index'
export default {
    data() {
        return {
            tit: "确认订单",
            value:1,
            list:{},
            price:''
        };
    },
    components: {
        Tit,
    },
    methods:{
        onSubmit(){
            // console.log(123);
            getAddUserlist({userId:this.$store.state.userId,goodsId:this.list.id,status:2})
            this.$router.push({path:'shoplist'})
        }
    },
    created(){
        this.list = this.$store.state.shoplist
        // console.log(this.list.price.substr(1));
        this.price = parseInt(this.list.price.substr(1)) * 100
    },
    
};
</script>

<style scoped lang='less'>
.order{
    min-height: 1334px;
}
.order {
    background-color: #efefef;
    .top {
        width: 100%;
        height: 130px;
        margin-top: 20px;
        background-color: white;
        font-size: 28px;  
        div {
            vertical-align: top;
            margin-left: 40px;
            box-sizing: border-box;
            padding-top: 20px;
            span {
                float: right;
                margin-right: 40px;
            }
        }
        .second{
            padding-top: 16px;
        }
    }
}

.card {
    width: 710px;
    height: 190px;
    background-color: white;
    margin: auto;
    border-radius: 10px;
    margin-top: 20px;
}
.van-row {
    width: 100%;
    height: 190px;
    .checkbox {
        line-height: 190px;
        input {
            margin-left: 20px;
            width: 20px;
            height: 20px;
        }
    }
    .main {
        height: 190px;
        overflow: hidden;
        .pic {
            width: 185px;
            margin: 26px 0;
            float: left;
            img {
                width: 185px;
                height: 138px;
            }
        }
        .dis{
            width: 300px;
            float: left;
            margin: 20px;
            margin-top: 50px;
            font-size: 30px;
            .red{
                color: red;
            }
        }
    }
}
.line{
    margin-top: 48px;
    font-size: 20px;
    margin-left: 40px;
    span{
        float: right;
        margin-right: 40px;
    }
}
</style>